﻿Imports System
Public Class frmAddClient
    Public Sub Loadform() Handles Me.Load
        txtFirstName.Width = ClientSize.Width - (2 * txtFirstName.Left)
        txtLastName.Width = ClientSize.Width - (2 * txtFirstName.Left)
        txtCompany.Width = ClientSize.Width - (2 * txtFirstName.Left)
        txtEmail.Width = ClientSize.Width - (2 * txtFirstName.Left)
        txtWork.Width = ClientSize.Width - (2 * txtFirstName.Left)
        txtMobile.Width = ClientSize.Width - (2 * txtFirstName.Left)
        txtNotes.Width = ClientSize.Width - (2 * txtFirstName.Left)
    End Sub
    Private Sub MenuItemTime2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItemTime2.Click
        Me.Hide()
    End Sub

    Private Sub txtFirstName_OnFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtFirstName.GotFocus
        AutoScrollPosition = New Point(1, 1)
    End Sub

    Private Sub MenuItemTime1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItemTime1.Click
        If Freshmobile.fbSubmitClient(txtFirstName.Text, txtLastName.Text, txtCompany.Text, txtEmail.Text, txtWork.Text, txtMobile.Text, txtNotes.Text) = 0 Then
            txtFirstName.Text = ""
            txtLastName.Text = ""
            txtCompany.Text = ""
            txtEmail.Text = ""
            txtWork.Text = ""
            txtMobile.Text = ""
            txtNotes.Text = ""
            txtFirstName.Focus()
        End If
    End Sub
End Class